/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lily
 * Date: 2024-09-22
 * Time: 16:16
 */
public class missing_Number {
    public int missingNumber(int[] nums) {
        int sum=0;
        for (int x : nums) {
            sum^=x;
        }
        for (int i = 0; i <= nums.length; i++) {
            sum^=i;
        }
        return sum;
    }
}
